package com.iis.hrms.persistence;

import javax.persistence.*;
import java.io.Serializable;
import java.util.List;

/**
 * The persistent class for the divisi database table.
 */
@Entity
@Table(name = "divisi")
@NamedQueries({
        @NamedQuery(name = "Divisi.findAll", query = "SELECT d FROM Divisi d"),
        @NamedQuery(name = "Divisi.findById", query = "SELECT d FROM Divisi d WHERE d.id = :id"),
        @NamedQuery(name = "Divisi.findByDivisionName", query = "SELECT d FROM Divisi d WHERE d.divisionName = :divisionName")})
public class Divisi implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(unique = true, nullable = false)
    private String id;

    @Column(name = "division_name", nullable = false, length = 255)
    private String divisionName;

    // bi-directional many-to-one association to Position
    @OneToMany(mappedBy = "divisi")
    private List<Position> positions;

    public Divisi() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getDivisionName() {
        return this.divisionName;
    }

    public void setDivisionName(String divisionName) {
        this.divisionName = divisionName;
    }

    public List<Position> getPositions() {
        return this.positions;
    }

    public void setPositions(List<Position> positions) {
        this.positions = positions;
    }

}